# 利用接口重新生成情感推理
# 首先对于老的data.list加入年龄性别信息。
from gxl_ai_utils.utils import utils_file
old_path = "/home/A02_tmpdata3/osum_s2s/emotion_yinshi_zxzhao_with_q_emo_by_cywang_added_by_20250701/handle_data/s2s_handle/xlgeng_new_data/emotion_data_raw/data_all.list"
output_root_dir = "/home/A02_tmpdata3/osum_s2s/emotion_yinshi_zxzhao_with_q_emo_by_cywang_added_by_20250701/handle_data/s2s_handle/xlgeng_new_data/emotion_data_raw/think_data"
# info_path = "/home/A02_tmpdata3/osum_s2s/emotion_yinshi_zxzhao_with_q_emo_by_cywang_added_by_20250701/handle_data/s2s_handle/xlgeng_new_data/data_all.list"
#
# data_list = utils_file.load_dict_list_from_jsonl(old_path)
# info_dict_list = utils_file.load_dict_list_from_jsonl(info_path)
# big_info_dict = {}
# for info_dict in info_dict_list:
#     big_info_dict[info_dict['key']] = info_dict
# no_key_num = 0
# for data_i in data_list:
#     key_i = data_i["key"]
#     if key_i in big_info_dict:
#         info_dict_i = big_info_dict[key_i]
#         data_i['extra_dict']['age'] = info_dict_i['extra']['age']
#         data_i['extra_dict']['gender'] = info_dict_i['extra']['gender']
#         data_i['extra'] = data_i['extra_dict']
#         data_i.pop('extra_dict')
#     else:
#         print(f"key {key_i} not found in info_dict_list,index {no_key_num}")
#         no_key_num += 1
#
# utils_file.write_dict_list_to_jsonl(data_list, old_path)
# utils_file.print_list(data_list[:10])
